﻿<UserControl x:Class="QuanLyKho.ucDmHamLuong"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
             xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" 
             xmlns:local="clr-namespace:QuanLyKho.CommonControl"
             >
   
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="70"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="42"></RowDefinition>
        </Grid.RowDefinitions>
        <GroupBox Grid.Row="0" Header="Thông tin hàm lượng" Margin="2 2 2 2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="60"></ColumnDefinition>
                    <ColumnDefinition Width="200*"></ColumnDefinition>
                    <ColumnDefinition Width="60"></ColumnDefinition>
                    <ColumnDefinition Width="200*"></ColumnDefinition>
                    <ColumnDefinition Width="80"></ColumnDefinition>
                    <ColumnDefinition MinWidth="60"></ColumnDefinition>
                    <ColumnDefinition MinWidth="60"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Text="Mã số:" Grid.Column="0" Grid.Row="0" Margin="2 2 2 2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <dxe:TextEdit x:Name="txtMaDVT" Grid.Column="1" Grid.Row="0" Margin="2 2 2 2" VerticalAlignment="Center"/>
                <!--<Image x:Name="btnTimMa" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" Margin="2 2 2 2"  
                       Source="/QuanLyKho;component/Images/Icons/zoom-32x32.png" Cursor="Hand" />-->
                
                <TextBlock Text="Tên:" Grid.Column="2" Grid.Row="0" Margin="2 2 2 2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <dxe:TextEdit x:Name="txtTenDVT" Grid.Column="3" Grid.Row="0" Margin="2 2 2 2" VerticalAlignment="Center"/>
                <!--<Image  x:Name="btnTimTen" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Right" Margin="2 2 2 2" Source="/QuanLyKho;component/Images/Icons/zoom-32x32.png" Cursor="Hand"/>-->
                
                <TextBlock Text="Kích hoạt:" Grid.Column="4" Grid.Row="0" Margin="2 2 2 2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <dxe:CheckEdit x:Name="chkKichHoat" IsChecked="True" Grid.Column="5" Grid.Row="0" Margin="2 2 2 2" VerticalAlignment="Center">
                    <dxe:CheckEdit.FocusVisualStyle>
                        <Style>
                            <Setter Property="Control.Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Rectangle Stroke="Black" Width="20" StrokeDashArray="1 2" Margin="-2" HorizontalAlignment="Left" StrokeThickness="1" SnapsToDevicePixels="True"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </dxe:CheckEdit.FocusVisualStyle>
                </dxe:CheckEdit>
            </Grid>
        </GroupBox>
        <dxg:GridControl Name="gridDsDmHamLuong" Grid.Row="1" Margin="2 2 2 2" ToolTip="Dòng đầu tiên của danh sách hỗ trợ tìm kiếm">
        <dxg:GridControl.Columns>

                <dxg:GridColumn Name="cluSTT" Header="STT" Width="50" AllowEditing="False">
                    <dxg:GridColumn.DisplayTemplate>
                        <ControlTemplate>
                            <dxe:TextEdit x:Name="thayDoiSTT" Text="{Binding Path =Data.RowHandle.Value,Converter ={local:RowHandleToStringConverter},Mode =OneWay}" HorizontalAlignment="Center" EditMode="InplaceActive" />                           
                        </ControlTemplate>
                    </dxg:GridColumn.DisplayTemplate>
                </dxg:GridColumn>
                <dxg:GridColumn Header="Mã hàm lượng" Width="100" MinWidth="50" FieldName="MaHamLuong" />
                <dxg:GridColumn Header="Tên hàm lượng" Width="150" MinWidth="50" FieldName="TenHamLuong"/>
                <dxg:GridColumn Header="Kích hoạt" Width="50" FieldName="KichHoat"/>           
        </dxg:GridControl.Columns>
        <dxg:GridControl.View>
            <dxg:TableView Name="view" AutoWidth="true" ShowGroupPanel="False" AllowEditing="False"
             MouseDoubleClick="view_MouseDoubleClick" KeyUp="view_KeyUp"
                           ShowAutoFilterRow="True" 
                        ShowGroupedColumns="False" 
                        ShowColumnHeaders="True"   
                        AllowDrop="False"
                        AllowGrouping="False" 
                        AllowMoveColumnToDropArea="False" 
                        AllowMoving="False" 
                        KeyboardNavigation.TabIndex="0"
                        IsColumnMenuEnabled="False"    
                        IsGroupPanelMenuEnabled="False" 
                        IsRowCellMenuEnabled="False" 
                        IsTotalSummaryMenuEnabled="False" 
                        AllowHorizontalScrollingVirtualization="True"
                        MaxWidth="1800"
                           />
        </dxg:GridControl.View>
    </dxg:GridControl>
        <dxb:BarManager Name="barManagerButton" Grid.Row="2" CreateStandardLayout="True">
            <dxb:BarManager.Items>
                <!--Regular bar items-->
                <dxb:BarButtonItem x:Name="btnThemMoi" Content="_Thêm mới" BarItemDisplayMode="ContentAndGlyph" 
                                   LargeGlyph ="/Images/Icons/new-32x32.png" ItemClick="btnThemMoi_ItemClick" />
                <dxb:BarButtonItem x:Name="btnLuu" Content="_Lưu" BarItemDisplayMode="ContentAndGlyph"  
                                   LargeGlyph ="/Images/Icons/save.png" ItemClick="btnLuu_ItemClick" />
                <dxb:BarButtonItem x:Name="btnXoa" Content="_Xóa" BarItemDisplayMode="ContentAndGlyph" 
                                   LargeGlyph ="/Images/Icons/deletered.png" ItemClick="btnXoa_ItemClick" />
                <dxb:BarButtonItem x:Name="btnHuyBo" Content="_Hủy bỏ" BarItemDisplayMode="ContentAndGlyph" 
                                   LargeGlyph ="/Images/Icons/undo.png" ItemClick="btnHuyBo_ItemClick" />
                <dxb:BarButtonItem x:Name="btnDong" Content="Đó_ng" BarItemDisplayMode="ContentAndGlyph" 
                                   LargeGlyph ="/Images/Icons/logout.png" ItemClick="btnDong_ItemClick" />
            </dxb:BarManager.Items>
            <!--Create two bars-->
            <dxb:BarManager.Bars>
                <dxb:Bar>
                    <dxb:Bar.ItemLinks>
                        <dxb:BarItemLink BarItemName="btnThemMoi"/>
                        <dxb:BarItemLink BarItemName="btnLuu"/>
                        <dxb:BarItemLink BarItemName="btnXoa"/>
                        <dxb:BarItemLink BarItemName="btnHuyBo"/>
                        <dxb:BarItemLink BarItemName="btnDong"/>
                    </dxb:Bar.ItemLinks>
                </dxb:Bar>
            </dxb:BarManager.Bars>
        </dxb:BarManager>
    </Grid>
</UserControl>
